AGENT_IMAGE := gluenet/agent
AGENT_IMAGE_TAG ?= latest

agentimg_gluenet: 
	APP=agent  DOCKERFILE_PATH=$(GOBASE)/deploy/docker/gluenetagent/Dockerfile make -s image

agentimg_kube: 
	APP=agent  DOCKERFILE_PATH=$(GOBASE)/deploy/docker/kubeagent/Dockerfile  make -s image

ingredients:
	docker build \
	  -t $(IMAGE_REPO)/ingredients:$(IMAGE_TAG) \
	  --build-arg TOOL_FILE=tools \
	  -f deploy/docker/ingredients/Dockerfile \
	  .

runagent_gluenet_solo:
	docker run \
	  -d \
      --net host \
      -e "HOST_NAME=${HOSTNAME}" \
      -e "GLUENET_CONFIG_ROOT=${HOME}/.gluenet/monitor/docker" \
      -v "/var/run/docker.sock:/var/run/docker.sock" \
      -v "${HOME}/.gluenet/:${HOME}/.gluenet/" \
      $(AGENT_IMAGE):$(AGENT_IMAGE_TAG) \
      sh -c "\cp -r /root/.gluenet/* ${HOME}/.gluenet/ && /app/agent --agent.config.path=${HOME}/.gluenet/agent_config.toml"

runagent_gluenet:
	docker run  \
	  -d \
      --net host \
      -e "HOST_NAME=${HOSTNAME}" \
      -e "GLUENET_CONFIG_ROOT=${HOME}/.gluenet/monitor/docker" \
      -v "/var/run/docker.sock:/var/run/docker.sock" \
      -v "${HOME}/.gluenet/:${HOME}/.gluenet/" \
      $(AGENT_IMAGE):$(AGENT_IMAGE_TAG) \
      sh -c "\cp -r /root/.gluenet/* ${HOME}/.gluenet/ && /app/agent --agent.config.path=${HOME}/.gluenet/agent_config.toml  --with.components"
